package com.jnzc.ocr.serv.shop.api;

import com.jnzc.ocr.common.bean.PageResult;
import com.jnzc.ocr.serv.shop.entity.ShopProduct;
import com.jnzc.ocr.serv.shop.filter.ShopProductFilter;
import com.jnzc.ocr.serv.shop.vo.ShopProductInfoVo;
import com.jnzc.ocr.serv.shop.vo.ShopProductSaveVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhangcm
 * @version 1.0, 2017-09-29
 */
@FeignClient("serv-shop")
@RequestMapping("/ShopProductApi")
public interface ShopProductApi {

    @PostMapping("/find")
    ShopProduct find(@RequestParam("id") Long id, @RequestParam("shopId") Long shopId);

    @PostMapping("/findInfo")
    ShopProductInfoVo findInfo(@RequestParam("id") Long id, @RequestParam("shopId") Long shopId);

    @PostMapping("/searchWithSku")
    PageResult<ShopProduct> searchWithSku(@RequestBody ShopProductFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);

    @PostMapping("/save")
    void save(@RequestBody ShopProductSaveVo param, @RequestParam("shopId") Long shopId);

    @PostMapping("/delete")
    void delete(@RequestParam("id") Long id, @RequestParam("shopId") Long shopId);

    @PostMapping("/clearLowStock")
    void clearLowStock(@RequestParam("shopId") Long shopId);

    @PostMapping("/updateLowStock")
    void updateLowStock(@RequestBody List<Long> idList, @RequestParam("shopId") Long shopId);

    @PostMapping("updateSale")
    void updateSale(@RequestParam("id") Long id, @RequestParam("shopId") Long shopId, @RequestParam("ifOnSale") Boolean ifOnSale);

}
